package com.bw.controller;

import com.bw.service.OrderInfoService;
import com.sugar.SugarUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
public class OrderController {


    @Autowired
    OrderInfoService orderInfoService;

    @GetMapping("/findOrderInfo")
    public List<Map<String,Object>> findOrderInfo(){

        return orderInfoService.findOrderInfo();
    }


    //翻牌器
    @PostMapping("/getList2")
    public Map getList2(){
        Double value =orderInfoService.getList2();
        Map flipNumberData= SugarUtil.getFlipNumberData(value);

        return flipNumberData;
    }




   public Map getLiat(){

        Double value=orderInfoService.getList2();

       Map flipNumberData= SugarUtil.getFlipNumberData(value);

       return flipNumberData;
   }










}
